import React, { useState, useCallback } from 'react';

import HeadTop from '@/components/HeadTop';
import Loading from '@/components/Loading';
import { MyContext } from '@/context/index';
import './index.less'
const { Provider } = MyContext

const Index = ({ children=<div className='no-data'>无更多数据...</div>, history }) => {

    const getHeadTopSearch = (val)=>{
        console.log(val,'val');
    }
    return (
        <div className='page-wrapper'>
            <Provider value={{ placeholderTxt: "请输入点检编号"}}>
                <HeadTop
                    title="设备点检"
                    rightTxt="点检记录"
                    history={history}
                    getHandleRight={() => history.push("/spotCheckRecord")}
                    search={true}
                    sendHandlePressVal={getHeadTopSearch}
                ></HeadTop>
            </Provider>
            <div className="page-body" style={{ padding: 15 }}>
                {children}
            </div>
        </div>
    )
}

export default Index
